var input = document.querySelectorAll('input')
var btn = document.querySelector('button')

var p = document.querySelector('p')

p.onclick = () => {
    location.href = '/register.html'
}

btn.onclick = () => {
    axios.get('/user/enroll' , {params : {username : input[0].value , pass : input[1].value}}).then((res)=>{
        alert(res.data.mas)
        if(res.data.code == 200){
            localStorage.setItem('token',res.data.token)
            localStorage.setItem('username',JSON.stringify(input[0].value))
            location.href = '/home.html'
        }
    })
}